import gps from "./gps.js"
import regesp from "./regesp.js"
const handlershopinfo = (e) => {
	e.distance = (e.distance / 1000).toFixed(1)
	e.commentLevel = e.commentLevel.toFixed(1)
	//处理坐标信息 latitude longitude
	let reslut = gps.bd09togcj02(e.longitude, e.latitude)
	e.longitude = reslut[0]
	e.latitude = reslut[1]

	// 处理标签
	if (e.shoplabel != null) {
		e.shoplabelList = e.shoplabel.split(' ')
	}
	if (e.combomoney != null) {
		e.combomoney = e.combomoney.toFixed(1)
	}
	if (e.comboshopmoney != null) {
		e.comboshopmoney = e.comboshopmoney.toFixed(1)
	}
	// console.log(e.area)
	let array = regesp.match(regesp.region, e.area)
	e.area = array[2]
	if (e.area == null) {
		// console.log("err")
		let array1 = array[0].split(" ")
		e.area = array1[2]
	}
	// console.log(array)
	return e
}

export default {
	handlershopinfo
}
